package com.example.config;

import com.example.entity.Car;
import com.example.entity.House;
import com.example.entity.Owner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {
    @Bean
    public House house() {
        return new House(100, "北京");
    }

    @Bean
    public Car car() {
        return new Car("奔驰2", 500000);
    }

    @Bean
    public Owner owner() {
        Owner owner = new Owner("张三", 30);
        owner.setHouse(house());
        owner.setCar(car());
        return owner;
    }
}
